using System.Collections;
using System.Collections.Generic;
using DG.Tweening;
using UnityEngine;

public class PausePage : UIPanel
{
    [SerializeField]
    private GameObject mask;
    void Awake()
    {
        UIManager.Instance.AddPanel(PanelId.Pause, this);
    }
    public override void Show()
    {
        MyAdManager.Instance.MyShowNative(0f);
        mask.SetActive(true);
        transform.DOScale(1f, 0.05f);
        base.Show();
    }
    public override void Hide()
    {
        mask.SetActive(false);
        transform.DOScale(0f, 0.5f);
        base.Hide();
    }
    public void OnClickContinueBtn()
    {
        Time.timeScale = 1f;
        Hide();
    }
    public void OnClickBackBtn()
    {
        Time.timeScale = 1f;
        Hide();
        UIManager.Instance.HideOrDestroy(PanelId.Ingame);
        UIManager.Instance.CreateOrOpen(PanelId.MainMenu);
        Main.Instance.gameStatus = GameStatus.Pause;
        Main.Instance.DestoryOldScene();
        Main.Instance.CreateNewScene();
    }
}
